﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcApplicationBindersSample.Models.BindRequiredModel>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	[BindRequired]
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>[BindRequired]</h2>
    <div>
        <% using (Html.BeginForm()) { %>
            <div>
                <fieldset>
                    <legend>Incoming model</legend>
                    <p>First name: <%: ViewData.Eval("FirstName") %></p>
                    <p>Last name: <%: ViewData.Eval("LastName") %></p>
                    <p>Age: <%: ViewData.Eval("Age") %></p>
                    <p>Address: <%: ViewData.Eval("Address") %></p>
                    <p class="note">
                        Note that there is no input for Address below. Since Address is marked [BindRequired],
                        the built-in binder will fail fast when it hits this property. To correct this, the form
                        should include an input for the Address property.
                    </p>
                </fieldset>
            </div>
            <div>
                <fieldset>
                    <legend>New input</legend>
                    <p>First name: <%: Html.TextBoxFor(m => m.FirstName) %> <%: Html.ValidationMessageFor(m => m.FirstName) %></p>
                    <p>Last name: <%: Html.TextBoxFor(m => m.LastName) %> <%: Html.ValidationMessageFor(m => m.LastName) %></p>
                    <p>Age: <%: Html.TextBoxFor(m => m.Age) %> <%: Html.ValidationMessageFor(m => m.Age) %></p>
                    <p><input type="submit" /></p>
                </fieldset>
            </div>
        <% } %>
    </div>
</asp:Content>
